<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>康纳天花系统后台</title>
<link href="/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="/css/admins/base.css" rel="stylesheet" type="text/css">
<link href="/css/plugs/jDatepicker/jDatepicker-min.css"  rel="stylesheet"  />
<link href="/css/validate.css" rel="stylesheet" type="text/css" />
<script src="/js/plugs/jquery.js"></script>
<script src="/js/admins/base.js"></script>
<script type="text/javascript" src="/js/plugs/jquery.imgupload.js"></script>
<script type="text/javascript" charset="utf-8" src="http://{#$smarty.server.HTTP_HOST#}/js/kindeditor3/kindeditor.js"></script>
<script src="/js/common/validate.js"></script>
<style type="text/css" >
.add-form {
	width:100%;
}
.add-form input{
	width:30em;
}
.uploader_item_box{
    width:115px;
    height:115px;
}
</style>
</head>

<body>

<!-- nav start-->
{# include file="$tpl_root_path/admins/base/navbar.html" #}
<!-- nav end -->    
    
    
    
    
<div class="container-fluid">
    
      <div class="row">
      
    <!-- left  box start-->     
       {# include file="$tpl_root_path/admins/base/left_menu.html" #}
    <!-- left  box end-->        
 
  <!-- right  box start-->  
         
     <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main right-box">
          
          <div class="menu-navbar">内容管理- 知之列表-知之发布</div>
          <!--<h3 class="page-header">知之发布 </h3>-->

       
          
          <div class="info-list-box">
          
          <div class="add-form">
                <form class="form-horizontal" method="post"   id="newsForm">
 
                    <div class="form-group">
                      <label for="inputEmail3" class="col-sm-2 control-label" >知之标题<span class="must-fill">*</span></label>
                      <div class="col-sm-10">
                        <input class="form-control"   type="text" size="30" name="title"  value="{#$data.TITLE#}" defaultshow="2-30个字"  checkItem="isBlank:'T|请填写知之标题',computeChar:'>2<30|知之标题不足2个字,标题不能超过30个字',isSimple:'T|知之标题太过简单'" >
                      </div>
                    </div>


                  

                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label" >知之正文<span class="must-fill">*</span></label>
                        <div class="col-sm-10" >
                            
                            <textarea name="info" id="info" errFunc="keErr" sucFunc="keSuc" style="width:750px;height:400px;" checkItem="isBlank:'T|请填写知之详情',isHasContact2:'T|不允许包含联系方式',computeWord:'>10|纯字数(不含html)不得小于10',computeHtml:'<50000|内容超出我们数据库限制，请减少内容',isSimple:'T|内容太过简单'">{#$data.CONTENT#}</textarea>
                            
                            <!--<div class="infotips" style="color:#F00;"></div>-->
                            
                        </div>
                        
                    </div>
                    


                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label" >知之图片</label>
                        <div class="col-sm-10">
                            <div class="clearfix">
                                <div  id="imgup"></div>
                                <span class="news_tips form_tips form_error_tips" style="display:none;"></span><a>&nbsp;</a>
                            </div>
                        </div>
                    </div>



                     
                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" name="sub"  class="btn btn-success" onclick="return checkPublish();">保&nbsp;&nbsp;存</button>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        &nbsp;&nbsp;
                        <a  href="/admins/news_manage.html" class="btn btn-default">返&nbsp;&nbsp;回</a>
                      </div>
                    </div>
               </form>
          </div>
    
          </div>
          
 

          
     </div>
 
  <!-- right  box end-->         
        
      </div>
</div>



</body>
</html>

<script type="text/javascript">

    //图片上传

    {# if  $imgjs #}
	
	{#$imgjs#}

    {#else#}
      $.imgUploader({
        containerid:'imgup',
        dir:'news',
        img_cnt_limit:1,
        max_file_size:1024,
        prevent_duplicates:1,
        extensions:'jpg,jpeg,gif,png',
        multi_selection:true,
        min_img_width:0,
        min_img_height:0,
        single_file:true
    });
    {#/if#}

    $("#imgup").bind("UploadComplete",function() {
        $('.form_tips').addClass(" form-ok").css("display","inline-block");
    });

 

    function checkPublish() {
        if (!validate()){
            return false;
		}
        //验证图片
		/*
        var pic = $("#imgup_filelist").html();
        if(pic == ''){

            $('.news_tips ').removeClass('form-ok').addClass("form-no").css("display","inline-block").text('请上传图片');
            return false;
        }else {
            $('.news_tips').removeClass('form-no form_error_tips').addClass("form-ok").css("display","inline-block").text(' ');

        }
		*/
		$('#newsForm').submit()
        return true
    }
 
 
 //编辑器验证通过/不通过时的回调函数
function keErr(){
    $(".ke-container").css('border-color','red');
}
function keSuc(){
    $(".ke-container").css('border-color','#ccc');
}

 //int function
 $(function(){
	 KE.show({id:'info',
        afterCreate: function(){
            var countDiv = '<div class="count-div"><span>字数：<span class="html-count"></span>(含HTML数,该字数不得超过50000)</span></div>';
            $('.ke-bottom-outer').html(countDiv);
        },
        afterFocus: function(){
            $(".ke-container").css('border-color','#0096ff');
            $('span#info_err_text').hide();
            $('.infotips').removeClass('Validform_wrong Validform_right').addClass('form_tips').text('不能含有联系方式').show();
        },
        afterBlur:function(){
            $('.infotips').hide();
            KE.sync('info');
            if($('#info').triggerHandler('blur')){
                $(".ke-container").css('border-color','#ccc');
            }else{
                $(".ke-container").css('border-color','red');
            };
        },
        afterChange : function(){
            $('.html-count').text(KE.count('info','html'));
        }
});

	 
 });
</script>